The present invention relates to computer systems. More specifically, the present invention relates to optimizing throughput during I/O operations to enhance system performance.
Input/Output (I/O) generally refers to the transfer of data between a computer and an I/O device, such as a hard disk. Traditionally, I/O operations were controlled by the central processing unit (CPU). The CPU accomplished this by issuing simple I/O instructions, which may have included nothing more than a read or write command and a source or destination of the data to be transferred.
In more conventional systems, I/O operations are typically controlled by special I/O processors. This gives the CPU more time to execute other critical tasks.
There are many ways to measure the efficiency of an I/O operation. One such way is to measure the xe2x80x9cthroughputxe2x80x9d of the I/O operation. Throughput actually represents the rate at which an I/O operation is performed (e.g., in Megabytes per second). If, for example, an I/O operation involves the transfer of 1 Megabyte of data, and that transfer takes 0.1 seconds to complete, the throughput is 10 Megabytes per second.
Throughput optimization is extremely important, as less than optimal throughput can significantly hinder the overall performance of the computer system. Optimizing throughput is particularly important when the amount of data to be transferred during an I/O operation (i.e., the I/O size) is exceptionally large, which is often the case when data is being transported, for example, over a network a network connection.
There are problems, however, associated with optimizing I/O operation throughput. The main problem is that no single technique or strategy for accomplishing an I/O operation is guaranteed to optimize throughput for each and every set of circumstances associated with the I/O operation. That is because each I/O operation may involve different circumstances, such as, different I/O devices (e.g., hard disks, CD ROMs, network devices), wherein each I/O device exhibits its own distinct characteristics which dictate how an I/O operation involving that I/O device should be accomplished. When the I/O operation involves transferring data over a network connection, network conditions such as traffic load and bandwidth restrictions associated with the network connection may affect throughput, and hence, the ability of one specific I/O technique or strategy to achieve optimal throughput.
Typically, the conventional strategy for optimizing throughput during an I/O operation is to maximize I/O size. In other words, conventional systems attempt to optimize throughput during I/O operations by reading as much data as possible from the source I/O device prior to writing the data to the intended destination I/O device. In theory, maximizing I/O size reduces the number of I/O requests (i.e., the number of read and write commands) that must be issued in order to complete the I/O operation. As will be illustrated in greater detail below, reducing the number of I/O requests reduces the number of hardware and/or software overhead operations that are required to complete the I/O operation, for example, issuing commands to reposition the read and/or write heads associated with a hard disk and, of course, physically repositioning them. While this conventional strategy may optimize I/O throughput under one set of circumstances, there is, as stated above, no guarantee that this same strategy will optimize I/O throughput under another set of circumstances. Simply stated, there are many factors that determine which of several I/O strategies are best suited to optimize throughput during a given I/O operation.
One factor that is highly likely to determine which of several I/O strategies is best suited for optimizing throughput is whether the I/O device (or devices) has an internal buffer or cache. Another factor is the amount of overhead involved with reading and/or writing the data from/to an I/O device. FIGS. 1A-1D illustrate how factors, such as whether an I/O device has an internal buffer, influence whether one I/O strategy, for example, a strategy that involves a relatively large I/O size, is more likely to optimize throughput than another I/O strategy, for example, a strategy that involves a relatively small I/O size.
More specifically, FIG. 1A illustrates the amount of time that may be required to complete an I/O operation that involves reading data from a first I/O device (e.g., a first hard disk) to a computer, and writing that data from the computer to a second I/O device (e.g., a second hard disk), where neither I/O device has an internal buffer or cache. In this example, four relatively small read operations and four relatively small write operations are needed to complete the I/O operation, where a certain amount of hardware and software overhead is associated with each read operation and each write operation.
In contrast, FIG. 1B illustrates that the I/O operation shown in FIG. 1A may be accomplished in a shorter period of time if I/O size is increased. As illustrated, increasing the I/O size results in fewer read and write operations. Fewer read and write operations, in turn, result in less time dedicated to overhead operations. As less time is needed for overhead operations, the overall I/O operation is completed in a shorter period of time. Since the same amount of data is transferred using the I/O strategy illustrated in FIG. 1B as compared to FIG. 1A, the throughput associated with the strategy illustrated in FIG. 1B is greater than the throughput associated with the strategy illustrated in FIG. 1A.
Contrary to the results achieved by employing the I/O strategies illustrated in FIGS. 1A and 1B, FIGS. 1C and 1D together illustrate that a shorter I/O size may result in optimal throughput when the I/O devices employ an internal buffer or cache, particularly xe2x80x9cread-aheadxe2x80x9d and/or xe2x80x9cwrite-behindxe2x80x9d cache, and accordingly, the read and write operations, in whole or in part, overlap in the time domain. More specifically, FIG. 1C illustrates that under these circumstances, a relatively large I/O size results in lower throughput as compared to the strategy shown in FIG. 1D, which involves a relatively small I/O size.
Given the above-identified problems associated with optimizing throughput during I/O operations, it would be highly desirable to provide a method and/or apparatus that is capable of adaptively establishing an I/O operation strategy that is most likely to optimize throughput during any given I/O operation, on a case-by-case basis.
The present invention involves optimizing throughput during I/O operations. Moreover, the present invention does so at runtime and/or continuously throughout the duration of the I/O operation. Thus, the present invention provides an adaptive technique for optimizing throughput, and it does so regardless of the specific hardware configuration associated with the I/O device or devices involved with the I/O operation, as well as additional factors that might otherwise impact the efficiency of the I/O operation.
In accordance with one aspect of the present invention, a method for adaptively improving throughput during an I/O operation is provided. The method involves transferring an amount of data corresponding to a first I/O request. An amount of data corresponding to a second I/O request is then adapted so that the throughput associated with the second I/O request increases as compared to the throughput associated with the first I/O request.
In accordance with another aspect of the present invention, a method for adaptively improving throughput during an I/O operation is provided. The method involves transferring data from a source device to a destination device through a plurality of I/O requests, and continuously increasing the I/O size of the I/O requests, until throughput has been maximized. Any remaining data associated with the I/O operation is then transferred through one or more I/O requests, where the I/O size associated with the one or more I/O requests is fixed and equal to the I/O size corresponding to maximum throughput.
In accordance with yet another aspect of the present invention, a technique, including a corresponding apparatus, for improving computer performance during an I/O operation is provided, wherein a portion of data associated with the I/O operation is transferred from a source device to a destination device, and a throughput value associated with this transfer of data is measured. A determination is then made as to whether the measured throughput value is greater than a previous throughput value. A next portion of data associated with the I/O operation is then transferred from the source device to the destination device, where the next portion of data is greater than the prior portion of data, if the aforementioned determination indicates that the measured throughput value is greater than the previous throughput value.
In accordance with still another aspect of the present invention, a technique, including a corresponding apparatus, for improving the performance of a computer system during an I/O operation, where a value representing an amount of time to transfer a portion of data from a source device to a destination device is stored. A portion of the data associated with the I/O operation is then transferred from the source device to the destination device, and the time required to complete this transfer is measured. A determination is then made as to whether the the measured amount of time is greater than the stored value. Then, a next portion of data is transferred, where the next portion of data is less than the prior portion of data, if it is determined that the measured amount of time is greater than the stored value. The value associated with the measured amount of time is then stored in place of the previously stored value.